package com.mck.mapper;

import com.mck.entity.FileInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * @version 1.0.0
 * @Author mck
 * @Date 2025/4/7 下午2:47
 * @注释
 */

@Mapper
public interface FileMapper {
    /**
     * 获取指定文件
     */
    List<FileInfo> getFileSpecific(FileInfo fileInfo);


    /**
     * 获取文件列表
     */
    @Select("select * from files")
    List<FileInfo> getFileList();

    /**
     * 上传文件
     */
    // @Insert("insert into files (file_name, file_path, file_type, user_id, upload_time) values (#{fileName},#{filePath},#{fileType},#{userId},#{uploadTime})")
    void uploadFile(FileInfo fileInfo);

    /**
     * 删除文件
     */
    // @Delete("delete from files where id = #{id}")
    void deleteFile(FileInfo fileInfo);
}
